package com.cloudlinkscm.base.filecenter.service;

import com.cloudlinkscm.base.filecenter.exception.AuthenticateFailureException;
import com.cloudlinkscm.base.filecenter.exception.InvalidRequestException;
import com.cloudlinkscm.base.filecenter.exception.NotAuthorizedException;
import com.cloudlinkscm.base.filecenter.model.dto.RequestAuthenticationDto;

/**
 * @author : tac
 * @date : 2017/7/25
 */
public interface RequestAuthenticationService {

    /**
     * 校验此次请求的有效性
     *
     * @exception InvalidRequestException
     */
    void verifyValidity(RequestAuthenticationDto dto) throws InvalidRequestException;

    /**
     * 执行授权验证
     *
     * @exception NotAuthorizedException
     * @exception AuthenticateFailureException
     */
    void doAuthenticate(RequestAuthenticationDto dto) throws NotAuthorizedException, AuthenticateFailureException;
}
